package cn.liit.weixin.message.model.resp;

import java.util.List;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import cn.liit.weixin.message.type.RespMessageType;

/**
 * 图文消息
 * @author boqi.zhang
 * 
 */
@XStreamAlias("xml")
public class NewsMessage extends RespBaseMessage{

	private String ArticleCount;//图文消息个数，限制为10条以内
	
	private List<Article> Articles;//多条图文消息信息，默认第一个item为大图,注意，如果图文数超过10，则将会无响应

	public NewsMessage(String articleCount, List<Article> articles) {
		super(RespMessageType.RESP_MESSAGE_TYPE_NEWS.getType());
		ArticleCount = articleCount;
		Articles = articles;
		this.setMsgType(RespMessageType.RESP_MESSAGE_TYPE_NEWS.getType());
	}

	public String getArticleCount() {
		return ArticleCount;
	}

	public void setArticleCount(String articleCount) {
		ArticleCount = articleCount;
	}

	public List<Article> getArticles() {
		return Articles;
	}

	public void setArticles(List<Article> articles) {
		Articles = articles;
	}

	@Override
	public String toString() {
		return "NewsMessage [ArticleCount=" + ArticleCount + ", Articles=" + Articles + "]";
	}
	@XStreamAlias("item")
	public static class Article {

		private String Title;//图文消息标题
		private String Description;//图文消息描述信息
		private String PicUrl;//图片链接，支持JPG、PNG格式，较好的效果为大图360*200，小图200*200
		private String Url;//点击图文消息跳转链接
		
		public Article() {
			super();
		}
		
		public Article(String title, String description, String picUrl, String url) {
			super();
			Title = title;
			Description = description;
			PicUrl = picUrl;
			Url = url;
		}

		public String getTitle() {
			return Title;
		}
		public void setTitle(String title) {
			Title = title;
		}
		public String getDescription() {
			return Description;
		}
		public void setDescription(String description) {
			Description = description;
		}
		public String getPicUrl() {
			return PicUrl;
		}
		public void setPicUrl(String picUrl) {
			PicUrl = picUrl;
		}
		public String getUrl() {
			return Url;
		}
		public void setUrl(String url) {
			Url = url;
		}

		@Override
		public String toString() {
			return "Article [Title=" + Title + ", Description=" + Description + ", PicUrl=" + PicUrl + ", Url=" + Url + "]";
		}
	}
}
